<?php
    function Project_Construct( $mode ) {
        global $libs;

        $libs->Load( 'db' );
        $libs->Load( 'baboo' );
        $libs->Load( 'privileges' );

        $req = isset( $_POST[ 'server' ] ) ? $_POST : $_GET;

        $serverSelected = !empty( $req[ 'server' ] ) ? $req[ 'server' ] : '';
        $dbSelected = !empty( $req[ 'database' ] ) ? $req[ 'database' ] : '';
        $tableSelected = !empty( $req[ 'table' ] ) ? $req[ 'table' ] : '';

        Baboo_Init( $serverSelected, $dbSelected, $tableSelected );
    }
    
    function Project_Destruct() {
        // add cleanup code here; this is called at the end of every script
    }
    
    function Project_PagesMap() {
        // routes to master elements
        return array(
            ""                  => "table/view",
            'newtable'          => 'table/create/view',
            'login'             => 'user/login',
            "test"              => "test",
            'example'           => 'mypage',
            'debug'             => 'developer/water',
            'unittest'          => 'developer/test/view',
            'priv'              => 'developer/privileges',
        );
    }
?>
